<template>
  <el-dialog :visible.sync="visible" v-dialogDrag :title="title" :close-on-click-modal="false" class="tl-dialog" width="1200px" @open="open" @close="close">
    <el-form class="tl-form" ref="form" :model="model" :rules="rules" label-width="150px" :disabled="disableEditSubmit">
			<el-row>
				<el-col :span="24">
					<el-form-item label="所属任务名称" prop="taskname" >
						<el-input v-model="model.taskname" type="textarea" maxlength="500" show-word-limit :rows="4"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="所属任务id" prop="taskid" >
						<el-input-number v-model="model.taskid" controls-position="right" :step="1" :min="0" style="width:100%"></el-input-number>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="关闭原因" prop="closereason" >
						<el-input v-model="model.closereason" type="textarea" maxlength="1000" show-word-limit :rows="4"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="备注" prop="description" >
						<el-input v-model="model.description" type="textarea" maxlength="1000" show-word-limit :rows="4"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="申请部门" prop="applydeptname"  :required="true" :rules="rules.validateRequire">
						<tl-ref-dept v-model="model.applydeptname" :initDisplayData.sync="model.dispapplydeptname" dataType="code" nameType="fullname" :singleSelect="true"></tl-ref-dept>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="申请部门编码" prop="applydeptcode" >
						<el-input v-model="model.applydeptcode"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="申请人姓名" prop="applyusername"  :required="true" :rules="rules.validateRequire">
						<tl-ref-user v-model="model.applyusername" :initDisplayData.sync="model.dispapplyusername" dataType="code" :singleSelect="true"></tl-ref-user>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="申请人工号" prop="applyusercode" >
						<el-input v-model="model.applyusercode"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="提交时间" prop="submitdate" >
						<el-date-picker v-model="model.submitdate" type="date" placeholder="提交时间" value-format="yyyy-MM-dd"></el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="审批流程" prop="flowid" >
						<el-select v-model="model.flowid" filterable clearable>
							<el-option v-for="item in codeModel.flowidList" :key="item.id" :label="item.name" :value="parseInt(item.id)" />
						</el-select>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="状态" prop="state" >
						<el-select v-model="model.state" filterable clearable>
							<el-option v-for="item in codeModel.stateList" :key="item.code" :label="item.name" :value="parseInt(item.code)" />
						</el-select>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="排序码" prop="sortcode">
						<el-input-number v-model="model.sortcode" controls-position="right" :step="1" :min="0" style="width:100%"></el-input-number>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="有效" prop="enabled">
						<el-radio-group v-model="model.enabled">
							<el-radio :label="parseInt(item.code)" v-for="item in codeModel.enabledList" :key="item.code">{{ item.name }}</el-radio>
						</el-radio-group>
					</el-form-item>
				</el-col>
			</el-row>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button :type="disableEditSubmit === false ? 'text' : 'primary'" @click="doCancelEdit">取消</el-button>
      <el-button type="primary" @click="doSubmitEdit" :loading="saveLoading" v-if="disableEditSubmit === false">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
/** mixins */
import { mixin_edit } from '@tapui/mixins/mixin_edit'
/** 子组件 */
/** 工具类 */
import { putAction, getAction, postAction, deleteAction } from '@tapui/utils/http'
/** VUE配置 */
export default {
  mixins: [mixin_edit],
  components: { },
  data() {
    return {
      moduleTitle: '项目任务关闭',
      urlPrefix: '/mpm/projectTaskClose/',
      url: {
        // 额外的url
      }
    }
  },
  methods: {
    loaded() {
      // 页面加载完毕执行
    }
  }
}
</script>

